

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>控制命令 &mdash; Ceph Documentation</title>
  

  
  <link rel="stylesheet" href="../../../_static/ceph.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/graphviz.css" type="text/css" />
  <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" />

  
  
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../../" src="../../../_static/documentation_options.js"></script>
        <script src="../../../_static/jquery.js"></script>
        <script src="../../../_static/underscore.js"></script>
        <script src="../../../_static/doctools.js"></script>
    
    <script type="text/javascript" src="../../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../../genindex/" />
    <link rel="search" title="Search" href="../../../search/" />
    <link rel="next" title="Ceph 社区" href="../../troubleshooting/community/" />
    <link rel="prev" title="迁移到 BlueStore" href="../bluestore-migration/" /> 
</head>

<body class="wy-body-for-nav">

   
  <header class="top-bar">
    

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../../" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../../">Ceph 存储集群</a> &raquo;</li>
        
          <li><a href="../">集群运维</a> &raquo;</li>
        
      <li>控制命令</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../../_sources/rados/operations/control.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
  </header>
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search"  style="background: #eee" >
          

          
            <a href="../../../">
          

          
            
            <img src="../../../_static/logo.png" class="logo" alt="Logo"/>
          
          </a>

          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../../search/" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../../../start/intro/">Ceph 简介</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../install/">安装 Ceph</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephadm/">Cephadm</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../../">Ceph 存储集群</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../../configuration/">配置</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../">运维</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="../operating/">操纵集群</a></li>
<li class="toctree-l3"><a class="reference internal" href="../health-checks/">健康检查</a></li>
<li class="toctree-l3"><a class="reference internal" href="../monitoring/">监控集群</a></li>
<li class="toctree-l3"><a class="reference internal" href="../monitoring-osd-pg/">监控 OSD 和归置组</a></li>
<li class="toctree-l3"><a class="reference internal" href="../user-management/">用户管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pg-repair/">修复 PG 不一致状态</a></li>
<li class="toctree-l3"><a class="reference internal" href="../data-placement/">数据归置概览</a></li>
<li class="toctree-l3"><a class="reference internal" href="../pools/">存储池</a></li>
<li class="toctree-l3"><a class="reference internal" href="../erasure-code/">纠删码</a></li>
<li class="toctree-l3"><a class="reference internal" href="../cache-tiering/">分级缓存</a></li>
<li class="toctree-l3"><a class="reference internal" href="../placement-groups/">归置组</a></li>
<li class="toctree-l3"><a class="reference internal" href="../balancer/">均衡器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../upmap/">使用 pg-upmap</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crush-map/">CRUSH 图</a></li>
<li class="toctree-l3"><a class="reference internal" href="../crush-map-edits/">手动编辑一个 CRUSH 图</a></li>
<li class="toctree-l3"><a class="reference internal" href="../stretch-mode/">Stretch Clusters</a></li>
<li class="toctree-l3"><a class="reference internal" href="../change-mon-elections/">Configure Monitor Election Strategies</a></li>
<li class="toctree-l3"><a class="reference internal" href="../add-or-rm-osds/">增加/删除 OSD</a></li>
<li class="toctree-l3"><a class="reference internal" href="../add-or-rm-mons/">增加/删除监视器</a></li>
<li class="toctree-l3"><a class="reference internal" href="../devices/">设备管理</a></li>
<li class="toctree-l3"><a class="reference internal" href="../bluestore-migration/">迁移到 BlueStore</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">命令参考</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#id2">监视器命令</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id3">系统命令</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id4">认证子系统</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id5">归置组子系统</a></li>
<li class="toctree-l4"><a class="reference internal" href="#osd">OSD 子系统</a></li>
<li class="toctree-l4"><a class="reference internal" href="#mds">MDS 子系统</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id7">监视器子系统</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/community/">Ceph 社区</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/troubleshooting-mon/">监视器故障排除</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/troubleshooting-osd/">OSD 故障排除</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/troubleshooting-pg/">归置组排障</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/log-and-debug/">日志记录和调试</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/cpu-profiling/">CPU 剖析</a></li>
<li class="toctree-l3"><a class="reference internal" href="../../troubleshooting/memory-profiling/">内存剖析</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../../man/">    手册页</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../troubleshooting/">故障排除</a></li>
<li class="toctree-l2"><a class="reference internal" href="../../api/">APIs</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../../../cephfs/">Ceph 文件系统</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../rbd/">Ceph 块设备</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../radosgw/">Ceph 对象网关</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/">Ceph 管理器守护进程</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../mgr/dashboard/">Ceph 仪表盘</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../api/">API 文档</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../architecture/">体系结构</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/developer_guide/">开发者指南</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../dev/internals/">Ceph 内幕</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../governance/">项目管理</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../foundation/">Ceph 基金会</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../ceph-volume/">ceph-volume</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/general/">Ceph 版本（总目录）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../releases/">Ceph 版本（索引）</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../security/">Security</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../glossary/">Ceph 术语</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../jaegertracing/">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../translation_cn/">中文版翻译资源</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../../">Ceph</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
<div id="dev-warning" class="admonition note">
  <p class="first admonition-title">Notice</p>
  <p class="last">This document is for a development version of Ceph.</p>
</div>
  <div id="docubetter" align="right" style="padding: 5px; font-weight: bold;">
    <a href="https://pad.ceph.com/p/Report_Documentation_Bugs">Report a Documentation Bug</a>
  </div>

  
  <div class="section" id="index-0">
<span id="id1"></span><h1>控制命令<a class="headerlink" href="#index-0" title="Permalink to this headline">¶</a></h1>
<div class="section" id="id2">
<h2>监视器命令<a class="headerlink" href="#id2" title="Permalink to this headline">¶</a></h2>
<p>监视器命令用 <code class="docutils literal notranslate"><span class="pre">ceph</span></code> 工具发出：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="p">[</span><span class="o">-</span><span class="n">m</span> <span class="n">monhost</span><span class="p">]</span> <span class="p">{</span><span class="n">command</span><span class="p">}</span>
</pre></div>
</div>
<p>命令格式通常是（但不总是）：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="p">{</span><span class="n">subsystem</span><span class="p">}</span> <span class="p">{</span><span class="n">command</span><span class="p">}</span>
</pre></div>
</div>
</div>
<div class="section" id="id3">
<h2>系统命令<a class="headerlink" href="#id3" title="Permalink to this headline">¶</a></h2>
<p>下列命令显示集群状态：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="o">-</span><span class="n">s</span>
<span class="n">ceph</span> <span class="n">status</span>
</pre></div>
</div>
<p>下列命令显示集群状态的运行摘要、及主要事件：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="o">-</span><span class="n">w</span>
</pre></div>
</div>
<p>下列命令显示监视器法定人数状态，包括哪些监视器参与着、哪个是首领。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">mon</span> <span class="n">stat</span>
<span class="n">ceph</span> <span class="n">quorum_status</span>
</pre></div>
</div>
<p>下列命令查询单个监视器状态，包括是否在法定人数里。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">tell</span> <span class="n">mon</span><span class="o">.</span><span class="p">[</span><span class="nb">id</span><span class="p">]</span> <span class="n">mon_status</span>
</pre></div>
</div>
<p>其中， <code class="docutils literal notranslate"><span class="pre">[id]</span></code> 的值可以从 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">-s</span></code> 的输出里获取。</p>
</div>
<div class="section" id="id4">
<h2>认证子系统<a class="headerlink" href="#id4" title="Permalink to this headline">¶</a></h2>
<p>要添加一个 OSD 的密钥环，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">auth</span> <span class="n">add</span> <span class="p">{</span><span class="n">osd</span><span class="p">}</span> <span class="p">{</span><span class="o">--</span><span class="ow">in</span><span class="o">-</span><span class="n">file</span><span class="o">|-</span><span class="n">i</span><span class="p">}</span> <span class="p">{</span><span class="n">path</span><span class="o">-</span><span class="n">to</span><span class="o">-</span><span class="n">osd</span><span class="o">-</span><span class="n">keyring</span><span class="p">}</span>
</pre></div>
</div>
<p>要列出集群的密钥及其能力，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">auth</span> <span class="n">ls</span>
</pre></div>
</div>
</div>
<div class="section" id="id5">
<h2>归置组子系统<a class="headerlink" href="#id5" title="Permalink to this headline">¶</a></h2>
<p>要显示所有归置组的统计信息，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">pg</span> <span class="n">dump</span> <span class="p">[</span><span class="o">--</span><span class="nb">format</span> <span class="p">{</span><span class="nb">format</span><span class="p">}]</span>
</pre></div>
</div>
<p>可用输出格式有 <code class="docutils literal notranslate"><span class="pre">plain</span></code> （默认）、 <code class="docutils literal notranslate"><span class="pre">json</span></code> 、 <code class="docutils literal notranslate"><span class="pre">json-pretty</span></code> 、 <code class="docutils literal notranslate"><span class="pre">xml</span></code> 和
<code class="docutils literal notranslate"><span class="pre">xml-pretty</span></code> 。实现监视器和其它工具时，最好用 <code class="docutils literal notranslate"><span class="pre">json</span></code> 格式。
JSON 格式分析起来比给人看的文本 <code class="docutils literal notranslate"><span class="pre">plain</span></code> 格式更具确定性，
Ceph 版本更迭时它的布局变化少得多。
<code class="docutils literal notranslate"><span class="pre">jq</span></code> 工具很适合从 JSON 输出中提取数据。</p>
<p>要显示卡在某状态的所有归置组，执行下列命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">pg</span> <span class="n">dump_stuck</span> <span class="n">inactive</span><span class="o">|</span><span class="n">unclean</span><span class="o">|</span><span class="n">stale</span><span class="o">|</span><span class="n">undersized</span><span class="o">|</span><span class="n">degraded</span> <span class="p">[</span><span class="o">--</span><span class="nb">format</span> <span class="p">{</span><span class="nb">format</span><span class="p">}]</span> <span class="p">[</span><span class="o">-</span><span class="n">t</span><span class="o">|--</span><span class="n">threshold</span> <span class="p">{</span><span class="n">seconds</span><span class="p">}]</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">--format</span></code> 可以是 <code class="docutils literal notranslate"><span class="pre">plain</span></code> （默认）、 <code class="docutils literal notranslate"><span class="pre">json</span></code> 、
<code class="docutils literal notranslate"><span class="pre">json-pretty</span></code> 、 <code class="docutils literal notranslate"><span class="pre">xml</span></code> 或 <code class="docutils literal notranslate"><span class="pre">xml-pretty</span></code> 。</p>
<p><code class="docutils literal notranslate"><span class="pre">--threshold</span></code> 定义了多久算“卡住了”（默认 300 秒）</p>
<p><strong>Inactive</strong> 归置组不能处理读或写，因为它们在等待数据及时更新的
OSD 回来。</p>
<p><strong>Unclean</strong> 归置组包含副本数未达期望值的对象，
它们应该在恢复中。</p>
<p><strong>Stale</strong> 归置组处于未知状态——归置组所托付的 OSD 有一阵没向监视器报告了（由 <code class="docutils literal notranslate"><span class="pre">mon</span> <span class="pre">osd</span> <span class="pre">report</span> <span class="pre">timeout</span></code> 配置）。</p>
<p>删除“丢失”对象，或者恢复到其先前状态，可以是前一版本、
或如果刚创建就干脆删除。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">pg</span> <span class="p">{</span><span class="n">pgid</span><span class="p">}</span> <span class="n">mark_unfound_lost</span> <span class="n">revert</span><span class="o">|</span><span class="n">delete</span>
</pre></div>
</div>
</div>
<div class="section" id="osd">
<span id="osd-subsystem"></span><h2>OSD 子系统<a class="headerlink" href="#osd" title="Permalink to this headline">¶</a></h2>
<p>查询 OSD 子系统状态：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">stat</span>
</pre></div>
</div>
<p>把最新的 OSD 运行图拷贝到一个文件，参见
<a class="reference internal" href="../../../man/8/osdmaptool/#osdmaptool"><span class="std std-ref">osdmaptool</span></a> ：:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">getmap</span> <span class="o">-</span><span class="n">o</span> <span class="n">file</span>
</pre></div>
</div>
<p>从最新 OSD 运行图拷出 CRUSH 图：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">getcrushmap</span> <span class="o">-</span><span class="n">o</span> <span class="n">file</span>
</pre></div>
</div>
<p>这个命令所做的事相当于：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">getmap</span> <span class="o">-</span><span class="n">o</span> <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">osdmap</span>
<span class="n">osdmaptool</span> <span class="o">/</span><span class="n">tmp</span><span class="o">/</span><span class="n">osdmap</span> <span class="o">--</span><span class="n">export</span><span class="o">-</span><span class="n">crush</span> <span class="n">file</span>
</pre></div>
</div>
<p>转储 OSD 运行图， <code class="docutils literal notranslate"><span class="pre">-f</span></code> 的可用格式有 <code class="docutils literal notranslate"><span class="pre">plain</span></code> 、 <code class="docutils literal notranslate"><span class="pre">json</span></code> 、 <code class="docutils literal notranslate"><span class="pre">json-pretty</span></code> 、
<code class="docutils literal notranslate"><span class="pre">xml</span></code> 和 <code class="docutils literal notranslate"><span class="pre">xml-pretty</span></code> ，如未指定 <code class="docutils literal notranslate"><span class="pre">--format</span></code> 则转储为纯文本。
上文已经说过， JSON 格式适合各种工具、脚本以及其它自动化工具。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">dump</span> <span class="p">[</span><span class="o">--</span><span class="nb">format</span> <span class="p">{</span><span class="nb">format</span><span class="p">}]</span>
</pre></div>
</div>
<p>把 OSD 运行图转储为树，每个 OSD 一行、
包含权重和状态。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">tree</span> <span class="p">[</span><span class="o">--</span><span class="nb">format</span> <span class="p">{</span><span class="nb">format</span><span class="p">}]</span>
</pre></div>
</div>
<p>找出某对象在哪里或应该在哪里：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="nb">map</span> <span class="o">&lt;</span><span class="n">pool</span><span class="o">-</span><span class="n">name</span><span class="o">&gt;</span> <span class="o">&lt;</span><span class="nb">object</span><span class="o">-</span><span class="n">name</span><span class="o">&gt;</span>
</pre></div>
</div>
<p>增加或挪动一个新 OSD 条目，要给出 id/name/weight 和位置参数。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">crush</span> <span class="nb">set</span> <span class="p">{</span><span class="nb">id</span><span class="p">}</span> <span class="p">{</span><span class="n">weight</span><span class="p">}</span> <span class="p">[{</span><span class="n">loc1</span><span class="p">}</span> <span class="p">[{</span><span class="n">loc2</span><span class="p">}</span> <span class="o">...</span><span class="p">]]</span>
</pre></div>
</div>
<p>从现有 CRUSH 图删除存在的条目（ OSD ）：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">crush</span> <span class="n">remove</span> <span class="p">{</span><span class="n">name</span><span class="p">}</span>
</pre></div>
</div>
<p>从现有 CRUSH 图删除存在的空桶：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">crush</span> <span class="n">remove</span> <span class="p">{</span><span class="n">bucket</span><span class="o">-</span><span class="n">name</span><span class="p">}</span>
</pre></div>
</div>
<p>把有效的桶从分级结构里的一个位置挪到另一个。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">crush</span> <span class="n">move</span> <span class="p">{</span><span class="nb">id</span><span class="p">}</span> <span class="p">{</span><span class="n">loc1</span><span class="p">}</span> <span class="p">[{</span><span class="n">loc2</span><span class="p">}</span> <span class="o">...</span><span class="p">]</span>
</pre></div>
</div>
<p>设置 <code class="docutils literal notranslate"><span class="pre">{name}</span></code> 所指条目的权重为 <code class="docutils literal notranslate"><span class="pre">{weight}</span></code> 。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">crush</span> <span class="n">reweight</span> <span class="p">{</span><span class="n">name</span><span class="p">}</span> <span class="p">{</span><span class="n">weight</span><span class="p">}</span>
</pre></div>
</div>
<p>把 OSD 标记为丢失，有可能导致永久性数据丢失，慎用！</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">lost</span> <span class="p">{</span><span class="nb">id</span><span class="p">}</span> <span class="p">[</span><span class="o">--</span><span class="n">yes</span><span class="o">-</span><span class="n">i</span><span class="o">-</span><span class="n">really</span><span class="o">-</span><span class="n">mean</span><span class="o">-</span><span class="n">it</span><span class="p">]</span>
</pre></div>
</div>
<p>创建新 OSD 。如果未指定 ID ，有可能的话将自动分配个新 ID 。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">create</span> <span class="p">[{</span><span class="n">uuid</span><span class="p">}]</span>
</pre></div>
</div>
<p>删除指定 OSD 。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">rm</span> <span class="p">[{</span><span class="nb">id</span><span class="p">}</span><span class="o">...</span><span class="p">]</span>
</pre></div>
</div>
<p>查询 OSD 运行图里的 max_osd 参数。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">getmaxosd</span>
</pre></div>
</div>
<p>导入指定 CRUSH 图。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">setcrushmap</span> <span class="o">-</span><span class="n">i</span> <span class="n">file</span>
</pre></div>
</div>
<p>设置 OSD 运行图的 <code class="docutils literal notranslate"><span class="pre">max_osd</span></code> 参数，
扩展存储集群时有必要。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">setmaxosd</span>
</pre></div>
</div>
<p>把 ID 为 <code class="docutils literal notranslate"><span class="pre">{osd-num}</span></code> 的 OSD 标记为 down 。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">down</span> <span class="p">{</span><span class="n">osd</span><span class="o">-</span><span class="n">num</span><span class="p">}</span>
</pre></div>
</div>
<p>把 OSD <code class="docutils literal notranslate"><span class="pre">{osd-num}</span></code> 标记为数据分布之外（即不给分配数据）。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">out</span> <span class="p">{</span><span class="n">osd</span><span class="o">-</span><span class="n">num</span><span class="p">}</span>
</pre></div>
</div>
<p>把 OSD <code class="docutils literal notranslate"><span class="pre">{osd-num}</span></code> 标记为数据分布之内（即分配了数据）。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="ow">in</span> <span class="p">{</span><span class="n">osd</span><span class="o">-</span><span class="n">num</span><span class="p">}</span>
</pre></div>
</div>
<p>设置或清空 OSD 运行图里的暂停标记。若设置了，
不会有 IO 请求发送到任何 OSD ；
用 <code class="docutils literal notranslate"><span class="pre">unpause</span></code> 清空此标记会导致重发未决的请求。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">pause</span>
<span class="n">ceph</span> <span class="n">osd</span> <span class="n">unpause</span>
</pre></div>
</div>
<p>把 <code class="docutils literal notranslate"><span class="pre">{osd-num}</span></code> 的覆盖权重（重设权重）设置为 <code class="docutils literal notranslate"><span class="pre">{weight}</span></code> ，权重相同的两个 OSD 大致会收到相同的 I/O 请求、
并存储相同数量的数据。 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">osd</span> <span class="pre">reweight</span></code> 命令可给 OSD 设置一个增益权重，有效值在 0 和 1 之间，
它使得 CRUSH 重新归置一定数量的、本应该放到此处的数据。
它不会影响 crush 图里所分配的权重，
在 CRUSH 分布算法没能理想地执行时，
它可作为一种纠正手段。比如，假设你的某个 OSD 使用率达到了 90% ，
但其它的大致都在 50% ，这时你就可以下调此权重来补偿它。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">reweight</span> <span class="p">{</span><span class="n">osd</span><span class="o">-</span><span class="n">num</span><span class="p">}</span> <span class="p">{</span><span class="n">weight</span><span class="p">}</span>
</pre></div>
</div>
<p>通过减少利用率过高的 OSD 的覆盖权重可以均衡 OSD 饱足感。
需要注意的是，这些覆盖也叫 <code class="docutils literal notranslate"><span class="pre">reweight</span></code> ，
默认是 1.00000 ，仅仅是相互之间的相对值，不是绝对值。
一定要把它们与 CRUSH 权重区别开来，
后者反映的是一个桶以 TiB 计算的绝对容量。
默认情况下，这个命令调整覆盖权重时会选择比平均利用率大或小 20% 的 OSD 们，
但是，如果你加上了 <code class="docutils literal notranslate"><span class="pre">threshold</span></code> ，就会采用这个百分比。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">reweight</span><span class="o">-</span><span class="n">by</span><span class="o">-</span><span class="n">utilization</span> <span class="p">[</span><span class="n">threshold</span> <span class="p">[</span><span class="n">max_change</span> <span class="p">[</span><span class="n">max_osds</span><span class="p">]]]</span> <span class="p">[</span><span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">increasing</span><span class="p">]</span>
</pre></div>
</div>
<p>要限制 OSD 权重调整的幅度，可以指定 <code class="docutils literal notranslate"><span class="pre">max_change</span></code> ，
默认为 0.05 。要限制调整的 OSD 数量，
再指定 <code class="docutils literal notranslate"><span class="pre">max_osds</span></code> ，默认是 4 。
增大这些参数可以加速 OSD 利用率的均衡，
也会潜在地增加对客户端操作的影响，因为一次挪动的数据更多。</p>
<p>要想确定调用时哪个还有哪些 PG 和 OSD 会受影响，
可以在执行前先测试。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">test</span><span class="o">-</span><span class="n">reweight</span><span class="o">-</span><span class="n">by</span><span class="o">-</span><span class="n">utilization</span> <span class="p">[</span><span class="n">threshold</span> <span class="p">[</span><span class="n">max_change</span> <span class="n">max_osds</span><span class="p">]]</span> <span class="p">[</span><span class="o">--</span><span class="n">no</span><span class="o">-</span><span class="n">increasing</span><span class="p">]</span>
</pre></div>
</div>
<p>给这些命令加上 <code class="docutils literal notranslate"><span class="pre">--no-increasing</span></code> 可以防止当前 &lt; 1.00000 的覆盖权重被增加。
在均衡一个需要急于补救的 <code class="docutils literal notranslate"><span class="pre">full</span></code> 或 <code class="docutils literal notranslate"><span class="pre">nearful</span></code> 的 OSD 时、
或者一些 OSD 正在维修、或者正在慢慢进入工作状态时，这个选项很有用。</p>
<p>用 Nautilus 部署的（或者 Luminous 和 Mimic 的后期修订版）
它们没有 Luminous 之前的辅佐，可以转而启用
<code class="docutils literal notranslate"><span class="pre">ceph-mgr</span></code> 的 <cite>balancer</cite> 模块。</p>
<p>增加、删除黑名单里的一个 IP 地址。增加地址的时候可以指定屏蔽时长（单位为秒），否则默认为 1 小时。
黑名单里的地址不允许连接任何 OSD 。黑名单机制最常用于防止滞后的元数据服务器改错 OSD 上的数据。</p>
<p>这些命令大多只在故障测试时有用，因为黑名单是自动维护的，
无需手动干涉。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">blocklist</span> <span class="n">add</span> <span class="n">ADDRESS</span><span class="p">[:</span><span class="n">source_port</span><span class="p">]</span> <span class="p">[</span><span class="n">TIME</span><span class="p">]</span>
<span class="n">ceph</span> <span class="n">osd</span> <span class="n">blocklist</span> <span class="n">rm</span> <span class="n">ADDRESS</span><span class="p">[:</span><span class="n">source_port</span><span class="p">]</span>
</pre></div>
</div>
<p>创建/删除存储池快照。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">pool</span> <span class="n">mksnap</span> <span class="p">{</span><span class="n">pool</span><span class="o">-</span><span class="n">name</span><span class="p">}</span> <span class="p">{</span><span class="n">snap</span><span class="o">-</span><span class="n">name</span><span class="p">}</span>
<span class="n">ceph</span> <span class="n">osd</span> <span class="n">pool</span> <span class="n">rmsnap</span> <span class="p">{</span><span class="n">pool</span><span class="o">-</span><span class="n">name</span><span class="p">}</span> <span class="p">{</span><span class="n">snap</span><span class="o">-</span><span class="n">name</span><span class="p">}</span>
</pre></div>
</div>
<p>创建/删除/重命名存储池。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">pool</span> <span class="n">create</span> <span class="p">{</span><span class="n">pool</span><span class="o">-</span><span class="n">name</span><span class="p">}</span> <span class="p">[</span><span class="n">pg_num</span> <span class="p">[</span><span class="n">pgp_num</span><span class="p">]]</span>
<span class="n">ceph</span> <span class="n">osd</span> <span class="n">pool</span> <span class="n">delete</span> <span class="p">{</span><span class="n">pool</span><span class="o">-</span><span class="n">name</span><span class="p">}</span> <span class="p">[{</span><span class="n">pool</span><span class="o">-</span><span class="n">name</span><span class="p">}</span> <span class="o">--</span><span class="n">yes</span><span class="o">-</span><span class="n">i</span><span class="o">-</span><span class="n">really</span><span class="o">-</span><span class="n">really</span><span class="o">-</span><span class="n">mean</span><span class="o">-</span><span class="n">it</span><span class="p">]</span>
<span class="n">ceph</span> <span class="n">osd</span> <span class="n">pool</span> <span class="n">rename</span> <span class="p">{</span><span class="n">old</span><span class="o">-</span><span class="n">name</span><span class="p">}</span> <span class="p">{</span><span class="n">new</span><span class="o">-</span><span class="n">name</span><span class="p">}</span>
</pre></div>
</div>
<p>更改存储池设置。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">pool</span> <span class="nb">set</span> <span class="p">{</span><span class="n">pool</span><span class="o">-</span><span class="n">name</span><span class="p">}</span> <span class="p">{</span><span class="n">field</span><span class="p">}</span> <span class="p">{</span><span class="n">value</span><span class="p">}</span>
</pre></div>
</div>
<p>可用的 field 值有：</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">size</span></code>: 设置存储池内数据的副本数；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pg_num</span></code>: 归置组数量；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pgp_num</span></code>: 计算归置组存放的有效数量；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">crush_rule</span></code>: 用于归置映射的规则号。</p></li>
</ul>
</div></blockquote>
<p>获取存储池配置值。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">pool</span> <span class="n">get</span> <span class="p">{</span><span class="n">pool</span><span class="o">-</span><span class="n">name</span><span class="p">}</span> <span class="p">{</span><span class="n">field</span><span class="p">}</span>
</pre></div>
</div>
<p>可用的 field 值有：</p>
<blockquote>
<div><ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">pg_num</span></code>: 归置组数量；</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">pgp_num</span></code>: 计算归置组存放的有效数量；</p></li>
</ul>
</div></blockquote>
<p>向 OSD <code class="docutils literal notranslate"><span class="pre">{osd-num}</span></code> 下达一个洗刷命令，用通配符 <code class="docutils literal notranslate"><span class="pre">*</span></code> 把命令下达到所有 OSD 。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">scrub</span> <span class="p">{</span><span class="n">osd</span><span class="o">-</span><span class="n">num</span><span class="p">}</span>
</pre></div>
</div>
<p>向 osdN 下达修复命令，用 <code class="docutils literal notranslate"><span class="pre">*</span></code> 下达到所有 OSD 。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">osd</span> <span class="n">repair</span> <span class="n">N</span>
</pre></div>
</div>
<p>在 osdN 上做个简单的吞吐量测试，每次写入 <code class="docutils literal notranslate"><span class="pre">BYTES_PER_WRITE</span></code> 、一共写入 <code class="docutils literal notranslate"><span class="pre">TOTAL_DATA_BYTES</span></code> 。默认以 4MB 增量写入 1GB 。
此压力测试是非破坏性的，不会覆盖已有 OSD 数据，
但可能会暂时影响同时访问此 OSD 的客户端性能。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">tell</span> <span class="n">osd</span><span class="o">.</span><span class="n">N</span> <span class="n">bench</span> <span class="p">[</span><span class="n">TOTAL_DATA_BYTES</span><span class="p">]</span> <span class="p">[</span><span class="n">BYTES_PER_WRITE</span><span class="p">]</span>
</pre></div>
</div>
<p>要清除测试期间某个 OSD 上的缓存，用 cache drop 命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">tell</span> <span class="n">osd</span><span class="o">.</span><span class="n">N</span> <span class="n">cache</span> <span class="n">drop</span>
</pre></div>
</div>
<p>要查看某一 OSD 缓存的统计信息，用 cache status 命令：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">tell</span> <span class="n">osd</span><span class="o">.</span><span class="n">N</span> <span class="n">cache</span> <span class="n">status</span>
</pre></div>
</div>
</div>
<div class="section" id="mds">
<h2>MDS 子系统<a class="headerlink" href="#mds" title="Permalink to this headline">¶</a></h2>
<p>更改在运行 mds 的参数：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">tell</span> <span class="n">mds</span><span class="o">.</span><span class="p">{</span><span class="n">mds</span><span class="o">-</span><span class="nb">id</span><span class="p">}</span> <span class="n">config</span> <span class="nb">set</span> <span class="p">{</span><span class="n">setting</span><span class="p">}</span> <span class="p">{</span><span class="n">value</span><span class="p">}</span>
</pre></div>
</div>
<p>例如：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">tell</span> <span class="n">mds</span><span class="mf">.0</span> <span class="n">config</span> <span class="nb">set</span> <span class="n">debug_ms</span> <span class="mi">1</span>
</pre></div>
</div>
<p>打开了调试消息。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">mds</span> <span class="n">stat</span>
</pre></div>
</div>
<p>显示所有元数据服务器状态。</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">mds</span> <span class="n">fail</span> <span class="mi">0</span>
</pre></div>
</div>
<p>把活跃 MDS 标记为失败，如果有候补此命令会触发故障转移。</p>
<div class="admonition-todo admonition" id="id6">
<p class="admonition-title">Todo</p>
<p><code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">mds</span></code> 子命令缺少文档：set, dump, getmap, stop, setmap</p>
</div>
</div>
<div class="section" id="id7">
<h2>监视器子系统<a class="headerlink" href="#id7" title="Permalink to this headline">¶</a></h2>
<p>查看监视器状态：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">mon</span> <span class="n">stat</span>

<span class="n">e2</span><span class="p">:</span> <span class="mi">3</span> <span class="n">mons</span> <span class="n">at</span> <span class="p">{</span><span class="n">a</span><span class="o">=</span><span class="mf">127.0.0.1</span><span class="p">:</span><span class="mi">40000</span><span class="o">/</span><span class="mi">0</span><span class="p">,</span><span class="n">b</span><span class="o">=</span><span class="mf">127.0.0.1</span><span class="p">:</span><span class="mi">40001</span><span class="o">/</span><span class="mi">0</span><span class="p">,</span><span class="n">c</span><span class="o">=</span><span class="mf">127.0.0.1</span><span class="p">:</span><span class="mi">40002</span><span class="o">/</span><span class="mi">0</span><span class="p">},</span> <span class="n">election</span> <span class="n">epoch</span> <span class="mi">6</span><span class="p">,</span> <span class="n">quorum</span> <span class="mi">0</span><span class="p">,</span><span class="mi">1</span><span class="p">,</span><span class="mi">2</span> <span class="n">a</span><span class="p">,</span><span class="n">b</span><span class="p">,</span><span class="n">c</span>
</pre></div>
</div>
<p>末尾的 <code class="docutils literal notranslate"><span class="pre">quorum</span></code> 列表列出了当前法定人数里的监视器节点。</p>
<p>也可以更直接地获取：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">quorum_status</span>
</pre></div>
</div>
<div class="highlight-javascript notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="s2">&quot;election_epoch&quot;</span><span class="o">:</span> <span class="mf">6</span><span class="p">,</span>
    <span class="s2">&quot;quorum&quot;</span><span class="o">:</span> <span class="p">[</span>
        <span class="mf">0</span><span class="p">,</span>
        <span class="mf">1</span><span class="p">,</span>
        <span class="mf">2</span>
    <span class="p">],</span>
    <span class="s2">&quot;quorum_names&quot;</span><span class="o">:</span> <span class="p">[</span>
        <span class="s2">&quot;a&quot;</span><span class="p">,</span>
        <span class="s2">&quot;b&quot;</span><span class="p">,</span>
        <span class="s2">&quot;c&quot;</span>
    <span class="p">],</span>
    <span class="s2">&quot;quorum_leader_name&quot;</span><span class="o">:</span> <span class="s2">&quot;a&quot;</span><span class="p">,</span>
    <span class="s2">&quot;monmap&quot;</span><span class="o">:</span> <span class="p">{</span>
        <span class="s2">&quot;epoch&quot;</span><span class="o">:</span> <span class="mf">2</span><span class="p">,</span>
        <span class="s2">&quot;fsid&quot;</span><span class="o">:</span> <span class="s2">&quot;ba807e74-b64f-4b72-b43f-597dfe60ddbc&quot;</span><span class="p">,</span>
        <span class="s2">&quot;modified&quot;</span><span class="o">:</span> <span class="s2">&quot;2016-12-26 14:42:09.288066&quot;</span><span class="p">,</span>
        <span class="s2">&quot;created&quot;</span><span class="o">:</span> <span class="s2">&quot;2016-12-26 14:42:03.573585&quot;</span><span class="p">,</span>
        <span class="s2">&quot;features&quot;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;persistent&quot;</span><span class="o">:</span> <span class="p">[</span>
                <span class="s2">&quot;kraken&quot;</span>
            <span class="p">],</span>
            <span class="s2">&quot;optional&quot;</span><span class="o">:</span> <span class="p">[]</span>
        <span class="p">},</span>
        <span class="s2">&quot;mons&quot;</span><span class="o">:</span> <span class="p">[</span>
            <span class="p">{</span>
                <span class="s2">&quot;rank&quot;</span><span class="o">:</span> <span class="mf">0</span><span class="p">,</span>
                <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;a&quot;</span><span class="p">,</span>
                <span class="s2">&quot;addr&quot;</span><span class="o">:</span> <span class="s2">&quot;127.0.0.1:40000\/0&quot;</span><span class="p">,</span>
                <span class="s2">&quot;public_addr&quot;</span><span class="o">:</span> <span class="s2">&quot;127.0.0.1:40000\/0&quot;</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">&quot;rank&quot;</span><span class="o">:</span> <span class="mf">1</span><span class="p">,</span>
                <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;b&quot;</span><span class="p">,</span>
                <span class="s2">&quot;addr&quot;</span><span class="o">:</span> <span class="s2">&quot;127.0.0.1:40001\/0&quot;</span><span class="p">,</span>
                <span class="s2">&quot;public_addr&quot;</span><span class="o">:</span> <span class="s2">&quot;127.0.0.1:40001\/0&quot;</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">&quot;rank&quot;</span><span class="o">:</span> <span class="mf">2</span><span class="p">,</span>
                <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;c&quot;</span><span class="p">,</span>
                <span class="s2">&quot;addr&quot;</span><span class="o">:</span> <span class="s2">&quot;127.0.0.1:40002\/0&quot;</span><span class="p">,</span>
                <span class="s2">&quot;public_addr&quot;</span><span class="o">:</span> <span class="s2">&quot;127.0.0.1:40002\/0&quot;</span>
            <span class="p">}</span>
        <span class="p">]</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>如果法定人数未形成，上述命令会一直等待。</p>
<p>只看单个监视器的状态：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">tell</span> <span class="n">mon</span><span class="o">.</span><span class="p">[</span><span class="n">name</span><span class="p">]</span> <span class="n">mon_status</span>
</pre></div>
</div>
<p>其中， <code class="docutils literal notranslate"><span class="pre">[name]</span></code> 的值取自 <code class="docutils literal notranslate"><span class="pre">ceph</span> <span class="pre">quorum_status</span></code> ，
其输出样本：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
    <span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;b&quot;</span><span class="p">,</span>
    <span class="s2">&quot;rank&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
    <span class="s2">&quot;state&quot;</span><span class="p">:</span> <span class="s2">&quot;peon&quot;</span><span class="p">,</span>
    <span class="s2">&quot;election_epoch&quot;</span><span class="p">:</span> <span class="mi">6</span><span class="p">,</span>
    <span class="s2">&quot;quorum&quot;</span><span class="p">:</span> <span class="p">[</span>
        <span class="mi">0</span><span class="p">,</span>
        <span class="mi">1</span><span class="p">,</span>
        <span class="mi">2</span>
    <span class="p">],</span>
    <span class="s2">&quot;features&quot;</span><span class="p">:</span> <span class="p">{</span>
        <span class="s2">&quot;required_con&quot;</span><span class="p">:</span> <span class="s2">&quot;9025616074522624&quot;</span><span class="p">,</span>
        <span class="s2">&quot;required_mon&quot;</span><span class="p">:</span> <span class="p">[</span>
            <span class="s2">&quot;kraken&quot;</span>
        <span class="p">],</span>
        <span class="s2">&quot;quorum_con&quot;</span><span class="p">:</span> <span class="s2">&quot;1152921504336314367&quot;</span><span class="p">,</span>
        <span class="s2">&quot;quorum_mon&quot;</span><span class="p">:</span> <span class="p">[</span>
            <span class="s2">&quot;kraken&quot;</span>
        <span class="p">]</span>
    <span class="p">},</span>
    <span class="s2">&quot;outside_quorum&quot;</span><span class="p">:</span> <span class="p">[],</span>
    <span class="s2">&quot;extra_probe_peers&quot;</span><span class="p">:</span> <span class="p">[],</span>
    <span class="s2">&quot;sync_provider&quot;</span><span class="p">:</span> <span class="p">[],</span>
    <span class="s2">&quot;monmap&quot;</span><span class="p">:</span> <span class="p">{</span>
        <span class="s2">&quot;epoch&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
        <span class="s2">&quot;fsid&quot;</span><span class="p">:</span> <span class="s2">&quot;ba807e74-b64f-4b72-b43f-597dfe60ddbc&quot;</span><span class="p">,</span>
        <span class="s2">&quot;modified&quot;</span><span class="p">:</span> <span class="s2">&quot;2016-12-26 14:42:09.288066&quot;</span><span class="p">,</span>
        <span class="s2">&quot;created&quot;</span><span class="p">:</span> <span class="s2">&quot;2016-12-26 14:42:03.573585&quot;</span><span class="p">,</span>
        <span class="s2">&quot;features&quot;</span><span class="p">:</span> <span class="p">{</span>
            <span class="s2">&quot;persistent&quot;</span><span class="p">:</span> <span class="p">[</span>
                <span class="s2">&quot;kraken&quot;</span>
            <span class="p">],</span>
            <span class="s2">&quot;optional&quot;</span><span class="p">:</span> <span class="p">[]</span>
        <span class="p">},</span>
        <span class="s2">&quot;mons&quot;</span><span class="p">:</span> <span class="p">[</span>
            <span class="p">{</span>
                <span class="s2">&quot;rank&quot;</span><span class="p">:</span> <span class="mi">0</span><span class="p">,</span>
                <span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;a&quot;</span><span class="p">,</span>
                <span class="s2">&quot;addr&quot;</span><span class="p">:</span> <span class="s2">&quot;127.0.0.1:40000\/0&quot;</span><span class="p">,</span>
                <span class="s2">&quot;public_addr&quot;</span><span class="p">:</span> <span class="s2">&quot;127.0.0.1:40000\/0&quot;</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">&quot;rank&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
                <span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;b&quot;</span><span class="p">,</span>
                <span class="s2">&quot;addr&quot;</span><span class="p">:</span> <span class="s2">&quot;127.0.0.1:40001\/0&quot;</span><span class="p">,</span>
                <span class="s2">&quot;public_addr&quot;</span><span class="p">:</span> <span class="s2">&quot;127.0.0.1:40001\/0&quot;</span>
            <span class="p">},</span>
            <span class="p">{</span>
                <span class="s2">&quot;rank&quot;</span><span class="p">:</span> <span class="mi">2</span><span class="p">,</span>
                <span class="s2">&quot;name&quot;</span><span class="p">:</span> <span class="s2">&quot;c&quot;</span><span class="p">,</span>
                <span class="s2">&quot;addr&quot;</span><span class="p">:</span> <span class="s2">&quot;127.0.0.1:40002\/0&quot;</span><span class="p">,</span>
                <span class="s2">&quot;public_addr&quot;</span><span class="p">:</span> <span class="s2">&quot;127.0.0.1:40002\/0&quot;</span>
            <span class="p">}</span>
        <span class="p">]</span>
    <span class="p">}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>监视器状态的一个转储：</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ceph</span> <span class="n">mon</span> <span class="n">dump</span>

<span class="n">dumped</span> <span class="n">monmap</span> <span class="n">epoch</span> <span class="mi">2</span>
<span class="n">epoch</span> <span class="mi">2</span>
<span class="n">fsid</span> <span class="n">ba807e74</span><span class="o">-</span><span class="n">b64f</span><span class="o">-</span><span class="mi">4</span><span class="n">b72</span><span class="o">-</span><span class="n">b43f</span><span class="o">-</span><span class="mi">597</span><span class="n">dfe60ddbc</span>
<span class="n">last_changed</span> <span class="mi">2016</span><span class="o">-</span><span class="mi">12</span><span class="o">-</span><span class="mi">26</span> <span class="mi">14</span><span class="p">:</span><span class="mi">42</span><span class="p">:</span><span class="mf">09.288066</span>
<span class="n">created</span> <span class="mi">2016</span><span class="o">-</span><span class="mi">12</span><span class="o">-</span><span class="mi">26</span> <span class="mi">14</span><span class="p">:</span><span class="mi">42</span><span class="p">:</span><span class="mf">03.573585</span>
<span class="mi">0</span><span class="p">:</span> <span class="mf">127.0.0.1</span><span class="p">:</span><span class="mi">40000</span><span class="o">/</span><span class="mi">0</span> <span class="n">mon</span><span class="o">.</span><span class="n">a</span>
<span class="mi">1</span><span class="p">:</span> <span class="mf">127.0.0.1</span><span class="p">:</span><span class="mi">40001</span><span class="o">/</span><span class="mi">0</span> <span class="n">mon</span><span class="o">.</span><span class="n">b</span>
<span class="mi">2</span><span class="p">:</span> <span class="mf">127.0.0.1</span><span class="p">:</span><span class="mi">40002</span><span class="o">/</span><span class="mi">0</span> <span class="n">mon</span><span class="o">.</span><span class="n">c</span>
</pre></div>
</div>
</div>
</div>



           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="../../troubleshooting/community/" class="btn btn-neutral float-right" title="Ceph 社区" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="../bluestore-migration/" class="btn btn-neutral float-left" title="迁移到 BlueStore" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2016, Ceph authors and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0).

    </p>
  </div> 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>